<?php
class Test_Event_Log_Handler_Stub_Handler extends Event_Log_Handler {
	protected $oMessage;
	public function message(){
		$this->oMessage = new Event_Log_Message('a', 'b');
		return $this->oMessage;
	}
	public function log(){
		parent::log($this->oMessage);
	}
}
class Test_Event_Log_Handler extends PHPUnit_Framework_TestCase {
	public function testLogReallyLogs(){
		$oLogStub = $this->getMock(
			'Event_Log_Device',
			array('add')
		);
		$oLogger = new Test_Event_Log_Handler_Stub_Handler($oLogStub, 'listens_to_something');
		$oLogStub
			->expects($this->once())
			->method('add')
			->with($this->equalTo((string) $oLogger->message()));
		$oLogger->log();
	}
}